package ua.com.softway.mail;

public abstract class MailMessage {
    public abstract String getSubject();

    public abstract String getBody();
    
    public String getReplyTo() {
        return null;
    }
    
    public int getPriority() {
        return 0;
    }

    public abstract String getTo();

    public void send() {
        GeneratedMessage message = generateMessage();
        
        Mailer.getQueue().offer(message);
    }

    protected GeneratedMessage generateMessage() {
		GeneratedMessage message = new GeneratedMessage(getReplyTo(), getSubject(), getBody(), getTo(), getPriority());

        return message;
	}
}
